<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>0412-01 立方体</title>
    <style>
        span{
            display: block;
            width:100%;
            height:100%;
            /*transform:rotateX(30deg);*/
            /*transform-origin:left center;*/
        }
        .box{
            position: relative;
            width: 200px;
            height: 200px;
            /*background-color: red;*/
            /*border: 1px solid #000;*/
            margin:100px auto;
            transform-style:preserve-3d;
            animation:gun 20s infinite alternate;

        }
        .box div{
            width: 200px;
            height: 200px;
            position: absolute;
            top:0;
            left:0;
            background:linear-gradient(to right,rgba(255,0,0,.8),rgba(255,255,0,.7));
            text-align: center;
            line-height:200px;
            font-size:100px;
            color:blue;
            text-shadow: 0px 0px 5px #000;
            transform-style:preserve-3d;

        }
        @keyframes gun {
            0%{
                transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
            }
            100%{
                transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
            }
        }
        .box1{
            transform: translateZ(100px) ;
        }
        .box2{
            transform: translateZ(-100px) rotateY(-180deg);
        }
        .box3{
            transform: translateX(-100px) rotateY(-90deg);
        }
        .box4{
            transform: translateX(100px) rotateY(90deg);
        }
        .box5{
            transform: translateY(-100px) rotateX(90deg);
        }
        .box6{
            transform: translateY(100px) rotateX(-90deg);
        }
    </style>
</head>
<body>
<div class="box">
    <div class="box1"><span>前</span></div>
    <div class="box2"><span>后</span></div>
    <div class="box3"><span>左</span></div>
    <div class="box4"><span>右</span></div>
    <div class="box5"><span>上</span></div>
    <div class="box6"><span>下</span></div>
</div>

</body>
</html>